package com.industrial.operation.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.industrial.common.core.utils.DateUtils;
import com.industrial.common.core.web.domain.AjaxResult;
import com.industrial.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.industrial.operation.mapper.OperationIndexManagerMapper;
import com.industrial.operation.domain.gxhzb.OperationIndexManager;
import com.industrial.operation.service.IOperationIndexManagerService;

/**
 * 工业运行评价-个性化指标管理Service业务层处理
 *
 * @author SangGuangCan
 * @date 2024-02-20
 */
@Service
public class OperationIndexManagerServiceImpl implements IOperationIndexManagerService
{
    @Autowired
    private OperationIndexManagerMapper operationIndexManagerMapper;

    /**
     * 查询工业运行评价-个性化指标管理
     *
     * @param baseId 工业运行评价-个性化指标管理主键
     * @return 工业运行评价-个性化指标管理
     */
    @Override
    public OperationIndexManager selectOperationIndexManagerByBaseId(String baseId)
    {
        return operationIndexManagerMapper.selectOperationIndexManagerByBaseId(baseId);
    }

    /**
     * 查询工业运行评价-个性化指标管理列表
     *
     * @param operationIndexManager 工业运行评价-个性化指标管理
     * @return 工业运行评价-个性化指标管理
     */
    @Override
    public List<OperationIndexManager> selectOperationIndexManagerList(OperationIndexManager operationIndexManager)
    {
        return operationIndexManagerMapper.selectOperationIndexManagerList(operationIndexManager);
    }

    /**
     * 新增工业运行评价-个性化指标管理
     *
     * @param operationIndexManager 工业运行评价-个性化指标管理
     * @return 结果
     */
    @Override
    public int insertOperationIndexManager(OperationIndexManager operationIndexManager)
    {
        operationIndexManager.setBaseId(IdUtil.simpleUUID());
        operationIndexManager.setBaseCreateTime(DateUtils.getNowDate());
        operationIndexManager.setBaseCreateBy(SecurityUtils.getUserId());
        operationIndexManager.setBaseUpdateTime(DateUtils.getNowDate());
        operationIndexManager.setBaseUpdateBy(SecurityUtils.getUserId());
        return operationIndexManagerMapper.insertOperationIndexManager(operationIndexManager);
    }

    /**
     * 修改工业运行评价-个性化指标管理
     *
     * @param operationIndexManager 工业运行评价-个性化指标管理
     * @return 结果
     */
    @Override
    public int updateOperationIndexManager(OperationIndexManager operationIndexManager)
    {
        return operationIndexManagerMapper.updateOperationIndexManager(operationIndexManager);
    }

    /**
     * 批量删除工业运行评价-个性化指标管理
     *
     * @param baseIds 需要删除的工业运行评价-个性化指标管理主键
     * @return 结果
     */
    @Override
    public int deleteOperationIndexManagerByBaseIds(String[] baseIds)
    {
        return operationIndexManagerMapper.deleteOperationIndexManagerByBaseIds(baseIds);
    }

    /**
     * 删除工业运行评价-个性化指标管理信息
     *
     * @param baseId 工业运行评价-个性化指标管理主键
     * @return 结果
     */
    @Override
    public int deleteOperationIndexManagerByBaseId(String baseId)
    {
        return operationIndexManagerMapper.deleteOperationIndexManagerByBaseId(baseId);
    }

    @Override
    public AjaxResult queryIndexInfo(OperationIndexManager operationIndexManager) {
        List<OperationIndexManager> operationIndexManagers = operationIndexManagerMapper.selectOperationIndexManagerList(operationIndexManager);
        return AjaxResult.success(operationIndexManagers);
    }
}